Skip to content

GridIconRegistry

Injectable service for managing grid icons.

Use provideGridIcons() in your app config to set up icons, or inject this service for dynamic registration.

// App-level setup (app.config.ts)
export const appConfig: ApplicationConfig = {
providers: [
provideGridIcons({
expand: '',
collapse: '',
sortAsc: '',
sortDesc: '',
})
]
};
// Dynamic registration
@Component({ ... })
export class AppComponent {
private registry = inject(GridIconRegistry);
ngOnInit() {
this.registry.set('filter', '<svg>...</svg>');
}
}

Set an icon override.

set(name: K, value: GridIcons[K]): void
NameTypeDescription
nameKThe icon name (e.g., ‘expand’, ‘collapse’, ‘filter’)
valueGridIcons[K]The icon value (string text or SVG markup)

Get an icon value.

get(name: K): GridIcons[K] | undefined
NameTypeDescription
nameK

Remove an icon override.

remove(name: keyof GridIcons): void
NameTypeDescription
namekeyof GridIcons

Check if an icon has an override.

has(name: keyof GridIcons): boolean
NameTypeDescription
namekeyof GridIcons

Get all registered icon names.

getRegisteredIcons(): keyof GridIcons[]

AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt