UNPKG

@crossed/demo

Version:

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

34 lines (33 loc) 1.05 kB
import { jsx, jsxs } from "react/jsx-runtime"; import { createButton } from "@crossed/primitive"; import { styled } from "@crossed/styled"; import { Box } from "@crossed/ui"; import { Pressable } from "react-native"; const Button = createButton({ Group: styled(Pressable, {}), Root: (props) => { return /* @__PURE__ */ jsx( "button", { className: "flex flex-row items-center bg-blue-500 px-3 py-2 hover:bg-blue-400 gap-2 rounded", ...props } ); }, Text: (props) => { return /* @__PURE__ */ jsx("span", { className: "text-white", ...props }); }, Element: (props) => { return /* @__PURE__ */ jsx("span", { ...props }); } }); const CreateButtonDemo = () => { return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Button, { "aria-label": "Button text", children: [ /* @__PURE__ */ jsx(Button.Element, { children: "\u20AC" }), /* @__PURE__ */ jsx(Button.Text, { children: "text button" }) ] }) }); }; export { CreateButtonDemo }; //# sourceMappingURL=simple.js.map