# use-disabled

Inherit the `disabled` status of a parent tag type `fieldset`, under certain rules:

1. The label must be on the lightDOM.
2. The component that uses this hook must declare the prop `{disabled: Boolean}`.

### Import

```javascript
import { useDisabled } from "@atomico/hooks/use-disabled";
```

### Sintaxis

```typescript
const disabled:boolean = useDisabled(matches?: string = "fieldset");
```

Where:

1. `matches`: Optional string, allows to change the search of the parent tag fieldset for another tag or selector compatible with [**Element.matches**](https://developer.mozilla.org/en-US/docs/Web/API/Element/matches).

### Example

{% embed url="<https://webcomponents.dev/edit/collection/n2tZyzx4LMKqk1jNE0e9/27OZ3Rbu02eJzcQe6C5G/src/index.jsx>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://atomico.gitbook.io/doc/packages/atomico-hooks/use-disabled.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
