React-bootstrap: Cannot remove caret in DropdownButton

Created on 22 Jan 2015  路  3Comments  路  Source: react-bootstrap/react-bootstrap

Surely there should be a prop or something like caret={false}?

Most helpful comment

Note: noCaret is not a prop for Dropdown.Toggle and .caret is not the classname. Instead the caret now renders in :after

.my-dropdown-toggle:after {
    display: none;
}

All 3 comments

You may just overwrite the default css in your current project instead by:-

.caret {
display: none;
}

Then the caret/dropdown arrow will be hidden, or customise the caret's css again based on your specific requirement.

Note: noCaret is not a prop for Dropdown.Toggle and .caret is not the classname. Instead the caret now renders in :after

.my-dropdown-toggle:after {
    display: none;
}

If you're using styled-components, you can apply this to any single menu toggle or export it for reuse.

const Toggle = styled(Dropdown.Toggle)`
    :after {
        display: none;
    }
`;
Was this page helpful?
0 / 5 - 0 ratings