Nhảy tới nội dung

Switch

Properties

Switch

NameTypeDefaultDescription
labelstring

Thêm nhãn cho switch

sizeSwitchSize

Kích thước của switch

wrapperClassNamestring

Thêm class name cho wrapper của switch

Type

SwitchSize

NameDescription
"small"

Size small

"medium"

Size medium

Example

import React from 'react';
import { Page, Switch, Text } from 'zmp-ui';

export default function HomePage(props) {
  return (
    <Page className='section-container'>
      <Text.Title size='small'>Switch</Text.Title>
      <p>Medium Size</p>
      <div>
        <Switch label='Label' />
      </div>
      <div>
        <Switch checked label='Label' />
      </div>
      <div>
        <Switch disabled label='Label' />
      </div>
      <div>
        <Switch checked disabled label='Label' />
      </div>
      <p>Small Size</p>
      <div>
        <Switch size='small' label='Label' />
      </div>
      <div>
        <Switch size='small' checked label='Label' />
      </div>
      <div>
        <Switch size='small' disabled label='Label' />
      </div>
      <div>
        <Switch size='small' checked disabled label='Label' />
      </div>
    </Page>
  );
}