Skip to content

Commit

Permalink
📝 docs(message,button): update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HoshinoSuzumi committed Nov 22, 2024
1 parent 222d2e8 commit d9ad42d
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/content/2.components/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ props:
Button
::

### Label

::ComponentPreview
---
props:
label: Button
---
::

### Disabled

::ComponentPreview
Expand All @@ -62,3 +71,8 @@ props:
---
Button
::

## Config

::ComponentDefaults
::
65 changes: 65 additions & 0 deletions docs/content/2.components/message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
description: The message component is used to display a message to the user
---

## Usage

First add the `<RayMessages>` component to your `app.vue`.

```js
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>

<RayMessages />
</template>
```

Then, use the `useMessage` composable to add notifications to your app anywhere you want.

```vue
<script lang="ts" setup>
const message = useMessage()
const showMessage = () => {
message.add({
content: 'Hello RayineSoft',
type: 'success',
})
}
</script>
<template>
<RayButton label="Show Message" @click="showMessage" />
</template>
```

### Type

Multiple preset styles with icons and colors.

::ComponentPreview
---
props:
type: info
content: Hello RayineSoft
---
::

### Color

Use the `color` prop to change the color of the message.

::ComponentPreview
---
props:
color: amber
content: Hello RayineSoft
---
::

## Config

::ComponentDefaults
::

0 comments on commit d9ad42d

Please sign in to comment.