@crossed/demo
Version:
A universal & performant styling library for React Native, Next.js & React
33 lines (32 loc) • 1.06 kB
JavaScript
import { jsx, jsxs } from "react/jsx-runtime";
import { createButton } from "@crossed/primitive";
import { styled } from "@crossed/styled";
import { Box } from "@crossed/ui";
import { Pressable, Text, View } from "react-native";
const Button = createButton({
Group: View,
Root: styled(Pressable, {
"className": [
"flex flex-row items-center",
"bg-blue-500",
"rounded",
"px-3 py-2",
"gap-2"
],
":hover": { className: ["bg-blue-400"] }
}),
Text: styled(Text, { className: ["text-base text-white"] }),
Element: (props) => {
return /* @__PURE__ */ jsx(Text, { ...props, style: [{ color: "white" }, props.style] });
}
});
const CreateButtonNativeDemo = () => {
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 {
CreateButtonNativeDemo
};
//# sourceMappingURL=simple.native.js.map