Skip to content

Commit

Permalink
updated doc
Browse files Browse the repository at this point in the history
  • Loading branch information
flodlc committed Nov 16, 2022
1 parent e1353c1 commit d964a63
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ const App = () => {
};
```

## The `as` attribute

The Box Component is the primitive component that allows you to access the sx property. By default it renders a div html element.
It accepts a `as` attribute to choose the needed tag.

```javascript
<Box as="a" href="#" sx={{ color: '$primary' }}>
My link
</Box>
```

> Of course, the href attribute type is well inferred from the "`a`" tag.
> And it works for all tags and Components !
## Reusable components

Components often need to be reusable and easily customisable with the sx property overriding.
Expand Down
17 changes: 16 additions & 1 deletion packages/lib/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Sx-machine
<h1 align="center">Sx-machine</h1>
<p align="center">First class Sx property for React.</p>

## Sx-machine is a lightweight library that provides a Box component for React and its themed SX property.

Expand Down Expand Up @@ -74,6 +75,20 @@ const App = () => {
};
```

## The `as` attribute

The Box Component is the primitive component that allows you to access the sx property. By default it renders a div html element.
It accepts a `as` attribute to choose the needed tag.

```javascript
<Box as="a" href="#" sx={{ color: '$primary' }}>
My link
</Box>
```

> Of course, the href attribute type is well inferred from the "`a`" tag.
> And it works for all tags and Components !
## Reusable components

Components often need to be reusable and easily customisable with the sx property overriding.
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "./dist/index.d.ts",
"type": "module",
"packageManager": "[email protected]",
"version": "1.0.8",
"version": "1.0.10",
"scripts": {
"dev": "run-p --continue-on-error watch:source watch:types",
"watch:types": "npx tsc -w",
Expand Down

0 comments on commit d964a63

Please sign in to comment.