<SegmentedControl /> with icons #7730
atumas-bananamilk
started this conversation in
Feature requests
Replies: 1 comment
|
+1. Since the other components consistently use <SegmentedControl
data={[
{ value: 'magic', label: 'Magic link', leftSection: <IconMail size={16} /> },
{ value: 'inbox', label: 'Inbox', rightSection: <Badge>12</Badge> },
]}
/>Related: a compound <SegmentedControl value={value} onChange={setValue}>
<SegmentedControl.Item value="magic" leftSection={<IconMail size={16} />}>
Magic link
</SegmentedControl.Item>
{/* or with label prop */}
<SegmentedControl.Item value="inbox" label="Inbox" rightSection={<Badge>12</Badge>} disabled />
</SegmentedControl>Both would let the component own the spacing instead of wrapping everything in a fragment inside |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Code isn't clean if doing React nodes as labels:
https://mantine.dev/core/segmented-control/#react-node-as-label
Could we just have a new parameter called
icon?I think many Mantine components have this.
All reactions