1.0.7 • Published 2 years ago

@twilentui/styled-components v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@twilentui/styled-components

Installation

yarn add @twilentui/styled-components

Import Package

import { twilent } from '@twilentui/styled-components';

Basic Usage

import { useState } from "react";
import { twilent, TwilentItem } from "@twilentui/styled-components";

interface ButtonProps extends TwilentItem {
  text: string;
}

const Button = twilent("button", {
    style: (props: any) => `background-color: #000;`
});

/*
const Button = twilent("button");
*/

export const CustomButton = (props: ButtonProps) => {
  const [count, setCount] = useState(0);

  return (
    <Button
      id="example-button"
      px="2rem"
      py="1.5rem"
      bgColor="blue"
      onClick={() => setCount(count + 1)}
      {...props}
    >
      {props.text} {count}
    </Button>
  );
};
1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago