> This page is for Designer API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# Check if a style is from a library

> Check if a style originated from a library.

## `style.isFromLibrary()`

Check if a style originated from a library, such as a Shared Library or AI Site Generation. This method is synchronous, so it doesn't require `await`.

> **Note**
>
> To read the origin as a value rather than a boolean, use the [`style.source`](/designer/reference/styles-overview#style-properties) property, which returns `'site'` or `'library'`.

#

### Syntax

```typescript
style.isFromLibrary(): boolean
```

### Returns

**`boolean`**

Returns `true` if the style originated from a library (Shared Library or AI Site Generation), and `false` otherwise.

#

### Example

```typescript
// Get all styles and filter to site-only global classes
const styles = await webflow.getAllStyles();
const siteOnlyClasses = styles.filter(
  (style) => style.getType() === "global" && !style.isFromLibrary()
);
```

[Try this example](https://webflow.com/oauth/authorize?response_type=code\&client_id=19511de1ec410f9228d8dcbc9420e67916dea80d86d18f0c9a533eb475ea0f62)

### Designer ability

| Designer Ability    | Locale | Branch | Workflow | Sitemode |
| :------------------ | :----- | :----- | :------- | :------- |
| **canAccessCanvas** | Any    | Any    | Any      | Any      |