Skip to content

Commit

Permalink
Incorporate PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
huong-li-nguyen committed Nov 19, 2024
1 parent 4f97688 commit 503d89d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
15 changes: 9 additions & 6 deletions vizro-core/docs/pages/user-guides/card-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,9 @@ img[src*="#my-image"] {
This section describes how to use the [`Card`][vizro.models.Card] component to create a navigation card,
enabling users to navigate to another page by clicking on the card area.

For a button-style navigation component, see the [guide on creating a link button](#create-a-link-button).
To configure the navigation panel on the left hand side of the screen, refer to the [guide on navigation](navigation.md).
For a button-style link navigation component, see the [separate guide on creating a link button](#create-a-link-button).
To configure the navigation panel on the left hand side of the screen, refer to the
[separate guide on navigation](navigation.md).

To create a navigation card:

Expand Down Expand Up @@ -633,21 +634,23 @@ You can configure the `text` argument to alter the display text of the [`Button`

### Create a link button

To navigate to different pages using a button with an anchor tag, provide an absolute or relative URL to the
To navigate to a different page using a button with an anchor tag, assign an absolute or relative URL to the
`Button.href`.

```python
import vizro.models as vm

vm.Button(text="Leave us a star! ⭐", href="https://github.com/mckinsey/vizro")
```

### Attach an action

You can use the [`Button`][vizro.models.Button] to trigger predefined action functions, such as exporting data.
To explore the available options for [`Actions`][vizro.models.Action], refer to our [API reference][vizro.actions].
Use the `Button.actions` argument to specify which action function should be executed when the button is clicked.
Use the `Button.actions` argument to specify which action function executes when the button is clicked.

In the example below, we demonstrate how to configure a button to export the filtered data of a target chart using the
[export_data][vizro.actions.export_data] action function
The example below demonstrates how to configure a button to export the filtered data of a target chart using the
[export_data][vizro.actions.export_data] action function.


!!! example "Button with action"
Expand Down
4 changes: 4 additions & 0 deletions vizro-core/examples/visual-vocabulary/assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ img[src*="#chart-icon"] {
position: relative;
}

.code-clipboard-container .pycafe-link {
margin-bottom: 12px;
}

.code-clipboard-container::-webkit-scrollbar-thumb {
border-color: var(--surfaces-bg-card);
}
Expand Down
1 change: 1 addition & 0 deletions vizro-core/examples/visual-vocabulary/custom_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def build(self):
],
href=f"https://py.cafe/snippet/vizro/v1#code={quote(self.code)}",
target="_blank",
className="pycafe-link",
)

return html.Div(
Expand Down

0 comments on commit 503d89d

Please sign in to comment.