Skip to content

Pills

Pills

jsx
import Pills from 'intergalactic/pills';
import Pills from 'intergalactic/pills';

PillsProps

& & & {...}
NameTypeDescription
size"l" | "m"Pills size
disabledbooleanDisabled state
onChange((value: , e: React.SyntheticEvent<>) => void) | React.Dispatch<React.SetStateAction<>>Called when the selection is changed
valueValue for the selected pill
defaultValueDefault value for the selected pill
behavior"tabs" | "radio" | "auto" | "manual"Sets semantic role for corresponding behavior, when set to `auto` pressing left and right arrows selects corresponding sibling pill. It's recommended to use `auto` behavior in forms while `manual` behavior for navigation and layout.

Pill.Item

jsx
import Pills from 'intergalactic/pills';
<Pills.Item />;
import Pills from 'intergalactic/pills';
<Pills.Item />;

PillProps

& & & {...}
NameTypeDescription
valuePill value
disabledbooleanDisabled state
selectedbooleanSelected state
addonLeftReact.ElementTypeLeft addon text
addonRightReact.ElementTypeRight addon tag

Pill.Item.Addon

The addon inside the pill (most often it is an icon) places the correct indent units depending on the size. Takes all properties of the Box.

jsx
import Pills from 'intergalactic/pills';
<Pills.Item.Addon />;
import Pills from 'intergalactic/pills';
<Pills.Item.Addon />;

Pill.Item.Text

Plain text, it sets correct indents depending on the size. If only text with no addons is used in the pill, it will be wrapped in Pills.Item.Text automatically. Takes all properties of the Box.

jsx
import Pills from 'intergalactic/pills';
<Pills.Item.Text />;
import Pills from 'intergalactic/pills';
<Pills.Item.Text />;

Released under the MIT License.

Released under the MIT License.