Last Updated on : 2024-06-05 03:14:31download
ControllerBar
is a control bar that contains one or more buttons. ControllerBar.Group
is a collection of control bars.
Note: for more information, see ControllerBar Demo.
import { ControllerBar } from "tuya-panel-kit";
<ControllerBar
size={44}
button={[
{ text: "1", type: "primary" },
{ text: "2", type: "primary" },
]}
/>;
import { ControllerBar } from "tuya-panel-kit";
<ControllerBar.Group style={{ marginTop: 20 }}>
<ControllerBar
size={44}
button={[
{ text: "1", type: "primary" },
{ text: "2", type: "primary" },
]}
/>
<ControllerBar
size={44}
button={[
{ text: "3", type: "primary" },
{ text: "4", type: "primary" },
]}
/>
</ControllerBar.Group>;
import { ControllerBar } from "tuya-panel-kit";
<ControllerBar.Group
type="swiper"
style={{ marginTop: 20 }}
swiperConfig={{
style: { height: 60 },
dotActiveStyle: { backgroundColor: "red" },
dotStyle: { backgroundColor: "blue" },
}}
size={44}
>
<ControllerBar
size={44}
button={[
{ text: "1", type: "primary" },
{ text: "2", type: "primary" },
]}
/>
<ControllerBar
size={44}
button={[
{ text: "3", type: "primary" },
{ text: "4", type: "primary" },
]}
/>
</ControllerBar.Group>;
import { ControllerBar } from "tuya-panel-kit";
<ControllerBar.Group type="divide" style={{ marginTop: 20 }}>
<ControllerBar
size={44}
button={[
{ text: "1", type: "primary" },
{ text: "2", type: "primary" },
]}
/>
<ControllerBar
size={44}
button={[
{ text: "3", type: "primary" },
{ text: "4", type: "primary" },
]}
/>
</ControllerBar.Group>;
The style of the outer container.
Type | Required |
---|---|
ViewPropTypes.style | No |
Button style.
Type | Required |
---|---|
ViewPropTypes.style | No |
The button background type.
primary
: the button follows global.brand
in the theme.normal
: the default background color is transparent
.Type | Required | Default value |
---|---|---|
enum |
No | normal |
Button size.
noSet
: the button size is not set, but filled with a child element.large
: the button is in a large size, 48 px.normal
: the button is in normal size, 40 px.small
: the button is in a small size, 32 px.Type | Required | Default value |
---|---|---|
enum/number |
No | noSet |
Stretch of the button follows the parent container.
Type | Required | Default value |
---|---|---|
bool |
No | true |
Whether the background is translucent.
pure
: pure.alpha
: translucent.Background color.
Type | Required | Default value |
---|---|---|
ColorPropType |
No | #fff |
Whether there is a border at the bottom.
Type | Required | Default value |
---|---|---|
bool |
No | false |
Buttons in the controllerBar
.
Type | Required | Default value |
---|---|---|
Array [ButtonPropTypes] |
Yes | None |
The style of the outer container.
Type | Required | Default value |
---|---|---|
ViewPropTypes.style | No | None |
Group type.
warp
: normal word-wrap.swiper
: slide.divide
: adjacent underlined style.Type | Required | Default value |
---|---|---|
enum |
No | warp |
Button size.
noSet
: the button size is not set, but filled with a child element.large
: the button is in a large size, 48 px.normal
: the button is in normal size, 40 px.small
: the button is in a small size, 32 px.Type | Required | Default value |
---|---|---|
enum/number |
No | noSet |
When type
is swiper
, this is the configuration of swiper
.
Type | Required | Default value |
---|---|---|
SwiperPropTypes | No | None |
Child nodes.
Type | Required | Default value |
---|---|---|
node |
Yes | None |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback