Topcoat Button Bar

Default style for Topcoat Button Bar.
Requirements are portable and accessible markup with flexible and performant css.
No javascript required

Normal Button Bar


Select Button Bar


Toggle Button Bar


Accessibility

The stateful button bars use inputs and the :checked pseudo style to add functionality without needing Javascript.

These stateful button bars rely on implicit ( or nested ) input labels instead of each needing an `id` and a matching `for` attribute on the corresponding label. This makes them more portable since each `id` on a page needs to be unique.

If you need to support legacy browsers and accessibility devices you can easily support these by adding the `id` and `for` attributes.

*look at HTML source


Semantic variations

This is where the CSS classes start to show their true benefit. You can use different semantic mark up to reflect your specific use case while maintiaing the same CSS classes.

If you are using this button bar as your primary navigation you could change the markup to reflect this semantically by using a nav element. Component looks the same with different mark up.

*look at HTML source

If you are using this button bar as a list of links you could change the markup to semantically reflect this by using an unorderd list with anchor tags. Again, component looks the same with different mark up.

*look at HTML source


Adding sizing

Topcoat separates layout and positioning from styling to make the components more reusable.
The below example has the layout class `full` added to elements to show how sizing can be applied.


@dam ♥s you