UNPKG

@crossed/demo

Version:

A universal & performant styling library for React Native, Next.js & React

37 lines (36 loc) 1.11 kB
import { jsx, jsxs } from "react/jsx-runtime"; import { tw } from "@crossed/styled"; import { styled } from "@crossed/styled"; import { Pressable, Text, TextInput } from "react-native"; const ButtonText = styled(Text, { className: ["text-white", "text-center"] }); const Button = styled(Pressable, { "className": ["px-3 py-2", "border border-neutral-700", "bg-neutral-800"], "props": { role: "button" }, ":hover": { className: ["bg-neutral-700"] }, ":active": { className: ["bg-neutral-900"] } }); const InputStyledFrom = styled(TextInput, { extends: Button.styles, className: ["text-left"], props: { placeholderTextColor: tw.color("neutral-500") } }); const ButtonExtendsNativeDemo = () => { return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5 justify-center p-5", children: [ /* @__PURE__ */ jsx(Button, { children: /* @__PURE__ */ jsx(ButtonText, { children: "Hover or Press" }) }), /* @__PURE__ */ jsx(InputStyledFrom, { placeholder: "Placeholder" }) ] }); }; export { ButtonExtendsNativeDemo }; //# sourceMappingURL=Extends.native.js.map