npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dev-indreka-checkbox

v1.0.3

Published

The Checkbox is a form element in web and application design that allows users to select/deselect an option from a list of choices. It is a fundamental component in designing user interfaces that require users to make a selection.

Downloads

2

Readme

Introduction

The Checkbox is a form element in web and application design that allows users to select/deselect an option from a list of choices. It is a fundamental component in designing user interfaces that require users to make a selection.

Anatomy

The Checkbox consists of a small square button. When the button is selected, it displays an animation of a checkmark inside it. The Checkbox is designed to work with other form elements, such as input fields and buttons, to create a comprehensive user interface.

Usage

The Checkbox is used to provide users with select/deselect option, and they can chose it like yesnNo. It is typically used in forms, questionnaires, and surveys. The Checkbox is also used in filters, search options, and settings where users need to select/deselect some options. When designing a Checkbox, it is important to consider their accessibility, usability, and visual design.

Differences from Other Form Elements

The Checkbox is often compared to other form elements, such as the toggle button, switch, and radio button. While they may look similar, they have different functions and usage. The toggle button and switch are used to toggle between two states, usually on/off or true/false. The checkbox allows users to select one or more options from a list of choices. The radio button, on the other hand, allows users to select only one option from a list of choices.

Checkbox Sizes

The table below provides the size specifications: | Size | Dimensions | Padding | Outter Circle(In hover and pressed state) | | ------------- | ---------- | -------- | ----------------------------------------- | | Mobile | 16 x 16 px | 2 x 2 px | 36 x 36 px | | Tablet | 18 x 18 px | 2 x 2 px | 38 x 38 px | | Web/Desktop | 20 x 20 px | 2 x 2 px | 40 x 40 px |

Checkbox Colors

The table below provides the color specifications: | Color | Hex code | | --------- | -------- | | Primary-1 | #FFB42A | | Neutral-1 | #262626 | | Neutral-2 | #6C6969 |

Checkbox States

The Checkbox Button component has several states, depending on the user's interaction with it | Color | Description | | -------- | ---------------------------------------------------------------------- | | Default | The initial state of the Checkbox component | | Hover | When the user hovers the mouse pointer over the Checkbox component | | Pressed | When the user clicks on the Checkbox component | | Disabled | When the Checkbox is not available for interaction |

indreka-checkbox component

The <indreka-checkbox></indreka-checkbox> component having the following property:

  1. name having type of string.
  2. value having type of string.
  3. checked having type of boolean.
  4. disabled having type of boolean.
  5. id having type of string.
  6. labelId having type of string.
  7. describerId having type of string.
  8. controlValue having type of string.
  9. required having type of boolean.
  10. error having type of string.

use

We can pass attributes inside like:

  1. name

-- This is the name of the checkbox which stores the name, this will stay same for a group of checkboxes.

  1. value

-- This is the value of the checkbox, this should always be different.

  1. checked

-- This will set the checkbox checked by default.

  1. disabled

-- This will disable the button preventing the user to perform any mouse events on button and also update the aria-disabled.

  1. id

-- This will set an id for the checkbox that can be used with an external label.

  1. labelId Text

-- Label id will require the name of the label element that will be the label for this checkbox, will update the aria-labelledby.

  1. describerId Text

-- Describer id will require the name of an element that is describing the button/any information about button. will update aria-describedby.

  1. required

-- This will set checkbox field is required

Angular use

We are using custom events for values. so, need to be implemented in the HTML code to get the checkbox values. checkboxEvent

<indreka-checkbox (checkboxEvent)="eventHandler($event)" >Text

--Example html <indreka-checkbox name="vehicle" value="car" (checkboxEvent)="handleCheckboxEvent($event)" >Text

ts handleCheckboxEvent(event: Event) { const customEvent = event as CustomEvent; console.log(customEvent.detail); -- will provide the checked value of Checkbox (true/false)

const nameValue = event.target as HTMLInputElement; console.log(nameValue.name); -- will fetch the name used (vehicle) console.log(nameValue.value); -- will fetch the value used (car) }