Chips

FloSports Brand has one chip style used to filter content or trigger actions.

Chips are used in the system to filter content, or trigger actions. While buttons are expected to appear consistently and with familiar calls to action, chips should appear dynamically as a group of multiple interactive elements.

<button type="button" class="chip chip-close chip-light">Sub 1</button>

System Extras

Here are extra variations on chips, imported from forking Bootstrap 4. These are not part of the design system, yet could be beneficial in the future.

<button type="button" class="chip chip-primary">Primary</button>
<button type="button" class="chip chip-secondary">Secondary</button>
<button type="button" class="chip chip-success">Success</button>
<button type="button" class="chip chip-danger">Danger</button>
<button type="button" class="chip chip-warning">Warning</button>
<button type="button" class="chip chip-info">Info</button>
<button type="button" class="chip chip-light">Light</button>
<button type="button" class="chip chip-dark">Dark</button>
Conveying meaning to assistive technologies

Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (e.g. the visible text), or is included through alternative means, such as additional text hidden with the .sr-only class.

Chips with Close Icon Variant

<button type="button" class="chip chip-close chip-light">Light</button>
<button type="button" class="chip chip-close chip-dark">Dark</button>

Disable text wrapping

If you don’t want the chip text to wrap, you can add the .text-nowrap class to the chip. In Sass, you can set $chip-white-space: nowrap to disable text wrapping for each chip.

<div class="w-10">
  <button class="chip chip-primary" type="submit">Amet deleniti eum non inventore?</button>
  <button class="chip chip-primary text-nowrap" type="submit">Amet deleniti eum non inventore?</button>
</div>

chip tags

The .chip classes are designed to be used with the <button> element. However, you can also use these classes on <a> or <input> elements (though some browsers may apply a slightly different rendering).

When using chip classes on <a> elements that are used to trigger in-page functionality (like collapsing content), rather than linking to new pages or sections within the current page, these links should be given a role="button" to appropriately convey their purpose to assistive technologies such as screen readers.

Link
<a class="chip chip-primary" href="#" role="button">Link</a>
<button class="chip chip-primary" type="submit">Button</button>
<input class="chip chip-primary" type="button" value="Input">
<input class="chip chip-primary" type="submit" value="Submit">
<input class="chip chip-primary" type="reset" value="Reset">

Gray chips

<button type="button" class="chip chip-100">100</button>
<button type="button" class="chip chip-200">200</button>
<button type="button" class="chip chip-300">300</button>
<button type="button" class="chip chip-400">400</button>
<button type="button" class="chip chip-500">500</button>
<button type="button" class="chip chip-600">600</button>
<button type="button" class="chip chip-700">700</button>
<button type="button" class="chip chip-800">800</button>
<button type="button" class="chip chip-900">900</button>

Outline chips

In need of a chip, but not the hefty background colors they bring? Replace the default modifier classes with the .chip-outline-* ones to remove all background images and colors on any chip.

<button type="button" class="chip chip-outline-primary">Primary</button>
<button type="button" class="chip chip-outline-secondary">Secondary</button>
<button type="button" class="chip chip-outline-success">Success</button>
<button type="button" class="chip chip-outline-danger">Danger</button>
<button type="button" class="chip chip-outline-warning">Warning</button>
<button type="button" class="chip chip-outline-info">Info</button>
<button type="button" class="chip chip-outline-light">Light</button>
<button type="button" class="chip chip-outline-dark">Dark</button>

Sizes

Fancy larger or smaller chips? Add .chip-lg or .chip-sm for additional sizes.

<button type="button" class="chip chip-primary chip-lg">Large chip</button>
<button type="button" class="chip chip-secondary chip-lg">Large chip</button>
<button type="button" class="chip chip-primary chip-sm">Small chip</button>
<button type="button" class="chip chip-secondary chip-sm">Small chip</button>

Active state

chips will appear pressed (with a darker background, darker border, and inset shadow) when active. There’s no need to add a class to <button>s as they use a pseudo-class. However, you can still force the same active appearance with .active (and include the aria-pressed="true" attribute) should you need to replicate the state programmatically.

<a href="#" class="chip chip-primary chip-lg active" role="button" aria-pressed="true">Primary link</a>
<a href="#" class="chip chip-secondary chip-lg active" role="button" aria-pressed="true">Link</a>

Disabled state

Make chips look inactive by adding the disabled boolean attribute to any <button> element.

<button type="button" class="chip chip-lg chip-primary" disabled>Primary button</button>
<button type="button" class="chip chip-secondary chip-lg" disabled>Button</button>

Disabled chips using the <a> element behave a bit different:

  • <a>s don’t support the disabled attribute, so you must add the .disabled class to make it visually appear disabled.
  • Some future-friendly styles are included to disable all pointer-events on anchor chips. In browsers which support that property, you won’t see the disabled cursor at all.
  • Disabled chips should include the aria-disabled="true" attribute to indicate the state of the element to assistive technologies.
<a href="#" class="chip chip-primary chip-lg disabled" tabindex="-1" role="button" aria-disabled="true">Primary link</a>
<a href="#" class="chip chip-secondary chip-lg disabled" tabindex="-1" role="button" aria-disabled="true">Link</a>

The .disabled class uses pointer-events: none to try to disable the link functionality of <a>s, but that CSS property is not yet standardized. In addition, even in browsers that do support pointer-events: none, keyboard navigation remains unaffected, meaning that sighted keyboard users and users of assistive technologies will still be able to activate these links. So to be safe, add a tabindex="-1" attribute on these links (to prevent them from receiving keyboard focus) and use custom JavaScript to disable their functionality.