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

docs(masked input): fix code annotations #5497

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion docs/widgets/masked_input.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ The example below shows a masked input to ease entering a credit card number.

=== "masked_input.py"

```python
```python hl_lines="6-13 25"
--8<-- "docs/examples/widgets/masked_input.py"
```

1. Textual offers default styling for the `-invalid` CSS class (a red border), which is automatically applied to the `MaskedInput` when validation fails. We can also provide custom styling for the `-valid` class, as seen here. In this case, we add a green border around the `MaskedInput` to indicate successful validation.
2. This example shows how to define a template mask for a credit card number, which requires 16 digits in groups of 4.

## Reactive Attributes

| Name | Type | Default | Description |
Expand Down