Skip to content

Commit 6a9c972

Browse files
committed
Fixed formatting for the readme
1 parent 7eee00d commit 6a9c972

3 files changed

Lines changed: 27 additions & 27 deletions

File tree

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
You can find the docs on the
1919
[docs website](https://react-slots-docs.vercel.app/)
2020

21-
## Simple Example: Implementing
21+
## Implementing
2222

23-
```jsx
23+
```tsx
2424
import { useSlot, SlotChildren, Slot } from "@beqa/react-slots";
2525

2626
type ListItemProps = {
2727
children: SlotChildren<
28-
| Slot<"title"> // Shorthand of Slot<"title", {}>
29-
| Slot<"thumbnail"> // Shorthand of Slot<"thumbnail", {}>
30-
| Slot<{ isExpanded: boolean }> // Shorthand of Slot<"default", {isExpanded: boolean}>
31-
>;
32-
}
28+
| Slot<"title"> // Shorthand of Slot<"title", {}>
29+
| Slot<"thumbnail"> // Shorthand of Slot<"thumbnail", {}>
30+
| Slot<{ isExpanded: boolean }> // Shorthand of Slot<"default", {isExpanded: boolean}>
31+
>;
32+
};
3333

3434
function ListItem({ children }: ListItemProps) {
3535
const { slot } = useSlot(children);
@@ -53,9 +53,9 @@ function ListItem({ children }: ListItemProps) {
5353
}
5454
```
5555

56-
## Simple Example: Specifying Slot Content From the Parent
56+
## Specifying Slot Content From the Parent
5757

58-
### With `slot-name` Attribute
58+
With `slot-name` attribute
5959

6060
```jsx
6161
<ListItem>
@@ -65,7 +65,7 @@ function ListItem({ children }: ListItemProps) {
6565
</ListItem>
6666
```
6767

68-
### With Templates
68+
With Templates
6969

7070
```jsx
7171
import { template } from "beqa/react-slots";
@@ -84,7 +84,7 @@ import { template } from "beqa/react-slots";
8484
</ListItem>;
8585
```
8686
87-
### With Type-safe Templates
87+
With type-safe templates
8888
8989
```tsx
9090
// Option #1
@@ -115,7 +115,7 @@ const template = template as CreateTemplate<ListItemProps["children"]>;
115115
| The code samples below represent actual implementations. No need to define external state or event handlers for these components to function. |
116116
| --------------------------------------------------------------------------------------------------------------------------------------------- |
117117

118-
#### Creating highly composable `Accordion` and `AccordionList` components using react-slots
118+
### Creating highly composable `Accordion` and `AccordionList` components using react-slots
119119

120120
Checkout
121121
[live example](https://stackblitz.com/edit/stackblitz-starters-tq32ef?file=pages%2Findex.tsx)
@@ -137,7 +137,7 @@ Checkout
137137
</AccordionList>
138138
```
139139

140-
#### Creating highly composable `Dialog` and `DialogTrigger` components using react-slots
140+
### Creating highly composable `Dialog` and `DialogTrigger` components using react-slots
141141

142142
Checkout
143143
[live example](https://stackblitz.com/edit/stackblitz-starters-fa5wbe?file=pages%2Findex.tsx)

packages/react-slots/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
You can find the docs on the
1919
[docs website](https://react-slots-docs.vercel.app/)
2020

21-
## Simple Example: Implementing
21+
## Implementing
2222

23-
```jsx
23+
```tsx
2424
import { useSlot, SlotChildren, Slot } from "@beqa/react-slots";
2525

2626
type ListItemProps = {
2727
children: SlotChildren<
28-
| Slot<"title"> // Shorthand of Slot<"title", {}>
29-
| Slot<"thumbnail"> // Shorthand of Slot<"thumbnail", {}>
30-
| Slot<{ isExpanded: boolean }> // Shorthand of Slot<"default", {isExpanded: boolean}>
31-
>;
32-
}
28+
| Slot<"title"> // Shorthand of Slot<"title", {}>
29+
| Slot<"thumbnail"> // Shorthand of Slot<"thumbnail", {}>
30+
| Slot<{ isExpanded: boolean }> // Shorthand of Slot<"default", {isExpanded: boolean}>
31+
>;
32+
};
3333

3434
function ListItem({ children }: ListItemProps) {
3535
const { slot } = useSlot(children);
@@ -53,9 +53,9 @@ function ListItem({ children }: ListItemProps) {
5353
}
5454
```
5555

56-
## Simple Example: Specifying Slot Content From the Parent
56+
## Specifying Slot Content From the Parent
5757

58-
### With `slot-name` Attribute
58+
With `slot-name` attribute
5959

6060
```jsx
6161
<ListItem>
@@ -65,7 +65,7 @@ function ListItem({ children }: ListItemProps) {
6565
</ListItem>
6666
```
6767

68-
### With Templates
68+
With Templates
6969

7070
```jsx
7171
import { template } from "beqa/react-slots";
@@ -84,7 +84,7 @@ import { template } from "beqa/react-slots";
8484
</ListItem>;
8585
```
8686
87-
### With Type-safe Templates
87+
With type-safe templates
8888
8989
```tsx
9090
// Option #1
@@ -115,7 +115,7 @@ const template = template as CreateTemplate<ListItemProps["children"]>;
115115
| The code samples below represent actual implementations. No need to define external state or event handlers for these components to function. |
116116
| --------------------------------------------------------------------------------------------------------------------------------------------- |
117117

118-
#### Creating highly composable `Accordion` and `AccordionList` components using react-slots
118+
### Creating highly composable `Accordion` and `AccordionList` components using react-slots
119119

120120
Checkout
121121
[live example](https://stackblitz.com/edit/stackblitz-starters-tq32ef?file=pages%2Findex.tsx)
@@ -137,7 +137,7 @@ Checkout
137137
</AccordionList>
138138
```
139139

140-
#### Creating highly composable `Dialog` and `DialogTrigger` components using react-slots
140+
### Creating highly composable `Dialog` and `DialogTrigger` components using react-slots
141141

142142
Checkout
143143
[live example](https://stackblitz.com/edit/stackblitz-starters-fa5wbe?file=pages%2Findex.tsx)

packages/react-slots/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@beqa/react-slots",
33
"private": false,
4-
"version": "1.0.3",
4+
"version": "1.0.4",
55
"description": "The react-slots runtime library",
66
"author": "Beqa",
77
"license": "MIT",

0 commit comments

Comments
 (0)