aws-amplify / amplify-ui

Amplify UI is a collection of accessible, themeable, performant React (and more!) components that can connect directly to the cloud.
https://ui.docs.amplify.aws
Apache License 2.0
884 stars 280 forks source link

Bug(primitive): Not able to pass down className to wrapping elements in Tabs primitive #4191

Closed hbuchel closed 10 months ago

hbuchel commented 1 year ago

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

React

Which UI component?

Primitive components

How is your app built?

React

What browsers are you seeing the problem on?

No response

Please describe your bug.

When applying a className at the top level to the primitive, it's a little misleading where it ends up. Instead of applying to an element wrapping the container, we apply it to our element that wraps the tab buttons.

Screenshot 2023-06-30 at 10 29 24 AM

What's the expected behaviour?

I would either expect a way to pass a className down to the parent level element or to have classes on those elements to make styling them easier.

Help us reproduce the bug!

Pass a className to the Tabs primitive:

<Tabs className="my-tabs-class">
  <TabItem title="Tab 1">
    <View className="my-tab-content-class">Tab 1 Content</View>
  </TabItem>
  <TabItem title="Tab 2">Tab 2 Content</TabItem>
</Tabs>

Code Snippet

// Put your code below this line.

Additional information and screenshots

No response

dbanksdesign commented 10 months ago

THIS IS FIXED NOW IN v6!!!