0.0.26 • Published 1 year ago

@ray-js/components-ty-actionsheet v0.0.26

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

English | 简体中文

@ray-js/components-ty-actionsheet

latest download

Tuya Style ActionSheet, the client has an API to provide actionsheet. If there is no special customization requirements, it is recommended to give priority to showActionSheet

Installation

$ npm install @ray-js/components-ty-actionsheet
# or
$ yarn add @ray-js/components-ty-actionsheet

Usage

Hooks

import ActionSheet from '@ray-js/components-ty-actionsheet';
import TimerPicker from '@ray-js/components-ty-time-picker';

const [time, setTime] = React.useState({
  hour: new Date().getHours(),
  minute: new Date().getMinutes(),
});

const handleTimeChange = (value: any) => {
  setTime(value);
};

const { modal, setVisible } = ActionSheet.useActionSheet({
  header: '请选择时间',
  content: () => <TimerPicker value={time} onChange={handleTimeChange} />,
});

<>
  <Button onClick={() => setVisible(true)}>选择时间</Button>
  {modal}
</>;

Control State

const [visible, setVisible] = React.useState(false);

<ActionSheet
  // overlayCloseable={false}
  show={visible}
  header="Title"
  onCancel={() => setVisible(false)}
>
  <SilderDemo />
</ActionSheet>;

Functional

const Popup = ActionSheet.createPopup();

<Button onClick={() =>
  Popup.open({
    header: 'Functional Popup',
    content: (
      <View style={{ padding: 16 }}>
         content
      </View>
    ),
  })
}>Open Popup</Button>

<Popup.Container />
0.0.25

1 year ago

0.0.26

1 year ago

0.0.24

2 years ago

0.0.21

2 years ago

0.0.23-beta-1

2 years ago

0.0.22-beta-1

2 years ago

0.0.20

2 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.19

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago