Skip to content

Commit

Permalink
Merge pull request #317 from Infineon/316-documentation-checkbox-imag…
Browse files Browse the repository at this point in the history
…e-width

changed image width and text
  • Loading branch information
tishoyanchev committed Aug 2, 2023
2 parents b0e55df + 47c783d commit 6747eb7
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions packages/components/src/components/checkbox/Usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,37 @@ There are two different checkbox sizes: 20px and 24px. The distinction between t

## Anatomy
<img src={CheckboxAnatomy} alt="Checkbox Anatomy" width="50%"/>
**Checkbox input (1)**\
**Checkbox Input (1)**\
The checkbox input represents a specific state and is initially set as unselected by default.

**Checkbox label (2)**\
**Checkbox Label (2)**\
Describes the information that you can choose to either select or deselect.

## Mouse interaction
## Mouse Interaction
To select an item, users have two options: they can either directly click on the checkbox input or click on the checkbox label. By making both areas interactive, it enhances the accessibility of the click target.
<img src={CheckboxMouseInteraction} alt="Checkbox Mouse Interaction" />
<img src={CheckboxMouseInteraction} alt="Checkbox Mouse Interaction" width="50%" />

## Grouping checkboxes
## Grouping Checkboxes
Deciding to place a checkbox group inline or block depends on the specific context and requirements of your user interface.

### Inline
<img src={CheckboxGroupInline} alt="Checkbox Group Inline" />
<img src={CheckboxGroupInline} alt="Checkbox Group Inline" width="50%" />
- Use to save space when you have limited screen real estate or need to place other elements alongside the checkboxes.
- Use when the options in your checkbox group have short labels, an inline layout can provide a more compact and visually streamlined presentation.
- Use to visually group related options or indicate that they belong to the same category.

### Block
<img src={CheckboxGroupBlock} alt="Checkbox Group Block" />
<img src={CheckboxGroupBlock} alt="Checkbox Group Block" width="50%" />
- Use for long checkbox labels.
- Use to visually separate checkbox options.

## Overflow text
## Overflow Text
If your labels get too long, they may wrap to a second line. Generally try to avoid of having too long labels. A maximum of three words should be rule.
<img src={CheckboxOverflowText} alt="Checkbox Overflow Text" />
<img src={CheckboxOverflowText} alt="Checkbox Overflow Text" width="50%" />

## States
<img src={CheckboxStates} alt="Checkbox States" />

***
Check out the Figma component: **[Checkbox](https://www.figma.com/file/zPvPwPgb4EsYFXKC2nhzSG/Infineon-DDS-%7C-Main?type=design&node-id=2583-7343&mode=design&t=VGECa2WmCtxIWNLe-4)**
***

0 comments on commit 6747eb7

Please sign in to comment.