Skip to content

Commit

Permalink
add docs for bool: (#874)
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah <[email protected]>
  • Loading branch information
titoBouzout and LadyBluenotes authored Sep 25, 2024
1 parent 4633355 commit 793a9ba
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/routes/reference/jsx-attributes/bool.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: bool:*
---

`bool:*` controls the presence of an attribute in an element.
When the value is `truthy` it adds the `attribute` to the element.
Alternatively, when the value is `falsy` it removes the `attribute` from the element.
This attribute is most useful for Web Components.

```tsx
<my-element bool:status={prop.value} />
```

```tsx
// Assuming `prop.value` is `truthy`, then it becomes
<my-element status />

// And when `falsy`, then it becomes
<my-element />

```
1 change: 1 addition & 0 deletions src/routes/reference/jsx-attributes/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"pages": [
"attr.mdx",
"classlist.mdx",
"bool.mdx",
"innerhtml-or-textcontent.mdx",
"on_.mdx",
"on-and-oncapture.mdx",
Expand Down

0 comments on commit 793a9ba

Please sign in to comment.