MYDS Logo

    MYDS

    Beta

    Pill

    Represent tags or categories in a textfield. Pills can contain text and may include an "x" button to allow for easy removal.

    New
    Trending
    Popular

    Usage

    import { Pill } from "@govtechmy/myds-react/pill";
    export default () => <Pill>Trending</Pill>;

    Examples

    Size

    Use the size prop to change the pill size.

    small
    medium
    large

    With Trailing "x" Button

    Pass a callback function to the onDismiss prop to show a trailing "x" button.

    With trailing "x" button

    Disabled

    Pill can be disabled by setting the disabled prop to true. When disabled, the pill will not be interactive. If the onDismiss prop is set, the "x" button will be hidden.

    Enabled
    Disabled

    Props

    Pill

    PropTypeDefault
    size
    enum
    small
    disabled
    boolean
    false
    onDismiss
    function
    -

    On this page