-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ToggleButton][ToggleButtonGroup] Create ToggleButton
and ToggleButtonGroup
#763
base: master
Are you sure you want to change the base?
Conversation
Netlify deploy preview |
6c0fe92
to
6e04229
Compare
e07b2ef
to
f23c6df
Compare
9bcba83
to
3a74374
Compare
ToggleButton
ToggleButton
and ToggleButtonGroup
7cc24fd
to
b06a97d
Compare
bcdd1cc
to
7c449d8
Compare
5d873bf
to
e4f7794
Compare
03bcd17
to
dd0c57d
Compare
@@ -25,6 +25,7 @@ const CompositeRoot = React.forwardRef(function CompositeRoot( | |||
itemSizes, | |||
loop, | |||
cols, | |||
isRtl, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rtl
without is
is fine; we match HTML naming without is
indicators
function App() { | ||
const [activeIndex, setActiveIndex] = React.useState(0); | ||
return ( | ||
<CompositeRoot activeIndex={activeIndex} onActiveIndexChange={setActiveIndex}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Composite
sets data-active
internally, but we use data-highlighted
for our components. We could remove the data-active
attr internally in Composite
and use the highlighted: boolean
ownerState instead to apply data-highlighted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the active
part of its ownerState
should be removed, or changed to highlighted
fe8bc95
to
846fde7
Compare
846fde7
to
724af6d
Compare
## RTL | ||
|
||
Use the `direction` prop to configure a RTL toggle button group: | ||
|
||
```tsx | ||
<ToggleButtonGroup.Root direction="rtl">{/* toggle buttons */}</ToggleButtonGroup.Root> | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this match the native dir
prop instead?
724af6d
to
8702100
Compare
Closes #11
Closes #31
Docs: