React
Props and native attributes
Section titled “Props and native attributes”Each component’s props are listed on its Code tab. Button’s props type extends the native button attributes (except children), and every attribute you pass that isn’t one of its own props is spread onto the rendered <button>:
<Button text="Delete" state="error" onClick={remove} aria-describedby="delete-help" disabled={busy} />typedefaults to"button". Because your attributes are spread after it,type="submit"overrides it.classNameis added to Button’s ownhz-buttonclasses, not substituted for them.- The label is the
textprop, which defaults to"Label". Button takes nochildren. - Icons:
startIconandendIconboth default totrueand show a decorative star. PassswapIconto render your own node in both positions instead, or set either flag tofalse.
Class names
Section titled “Class names”Every class a component adds itself starts with hz- (for Button: hz-button, hz-button__icon and one hz-button--<state> modifier). They’re part of the public surface, so a rename is a breaking change; see Versioning.
Themes
Section titled “Themes”Set data-theme="dark" on an element to switch everything inside it to the dark tokens. See Theming.