mirror of
https://github.com/zhigang1992/nativewind.git
synced 2026-06-12 17:08:19 +08:00
30 lines
597 B
Plaintext
30 lines
597 B
Plaintext
import Compatibility from "../_compatibility.mdx";
|
|
import RNSVG from "./_rn-svg.mdx";
|
|
|
|
# Stroke Width
|
|
|
|
## Usage
|
|
|
|
<RNSVG />
|
|
|
|
```tsx
|
|
import { styled } from "nativewind";
|
|
import { Svg, Rect } from "react-native-svg";
|
|
|
|
const StyledRect = styled(Rect, { classProps: ["fill", "stroke"] });
|
|
|
|
function MyStyledSvg({ stroke, ...props }) {
|
|
return (
|
|
<Svg height="100" width="100" {...props}>
|
|
<StyledRect x="0" y="0" width="100" height="100" stroke={stroke} />
|
|
</Svg>
|
|
);
|
|
}
|
|
|
|
<MyStyledSvg stroke="stroke-1" />;
|
|
```
|
|
|
|
## Compatibility
|
|
|
|
<Compatibility supported={["stroke-{n}", "stroke-[n]"]} />
|