Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: loading button #75

Open
wants to merge 1 commit into
base: release/next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions apps/pink/src/pages/elements/button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,32 @@ There are two sizes of buttons; large and medium. Each size has its own purpose,
</button>
</Preview>

## Loading

If you include the loader component inside a button, you can have a loading button.

| class | |
| ------------ | -------------------------------------------------- |
| `is-loading` | Use to represent a loading state within the button |

<Preview center>
<button id="loading-btn" class="button ">
<span class="text">Click me!</span>
<div class="loader"></div>
</button>

<script set:html={
`document.getElementById('loading-btn').addEventListener('click', () => {
document.getElementById('loading-btn').classList.add('is-loading')
setTimeout(() => {
document.getElementById('loading-btn').classList.remove('is-loading')
}, 2000)
})`
} />


</Preview>

## Buttons With Icons

Use icons in cases where they have a strong universal meaning and aid in the recognition of a button. In Appwrite, the icon is placed on the left by default.
Expand Down Expand Up @@ -135,3 +161,10 @@ Avoid using specific icons, uppercase in every word and long sentences.
:::

::::







Loading