yuai-autocomplete
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

yuai-autocomplete

Build Size PeerDependencies LatestVersion License

React autocomplete components with styled-components

Install

yarn install yuai-autocomplete react styled-components

Components

Autocomplete

import * as React from 'react';
import styled from 'styled-components';
import { Autocomplete, Option } from 'yuai-Autocomplete';

const StyledAutocomplete = styled(Autocomplete)`
  .yuai-autocomplete-input {
    padding: 10px 25px 10px 15px;
    font-size: 17px;
    width: 100%;
    border-radius: 3px 0 0 3px;
  }
`;

const HelloWorld = () => {
  const [ value, setValue ] = React.useState<Option | null>(null);
  const onSearch = (keyword) => getOption(keyword);
  const onChange = (selectedOption: Option | null) => setValue(selectedOption);

  return (
    <StyledAutocomplete
      required
      onSearch={onSearch}
      onChange={onChange}
    />
  );
};

License

MIT

Package Sidebar

Install

npm i yuai-autocomplete

Weekly Downloads

2

Version

0.0.3

License

MIT

Unpacked Size

11.7 kB

Total Files

8

Last publish

Collaborators

  • ozylog