useProps
Commons
stable
Returns a filterProps utility that picks only the keys declared on a component interface from an arbitrary props object, stripping undefined values so that Vue 3 boolean-prop coercion does not silently override withDefaults in child components. Used by composite components (DataTable, List, Select…) to forward a safe subset of their own props to child Origam components.
API
Signature
Full TypeScript signature sourced from the composable file.
Consumed interfaces
IFilterPropsOptions
API
Parameters
Input parameters accepted by this composable.
- propsrequiredT
- The component interface (or a plain object with the same keys) that defines the allowed prop surface. Only keys present here will be picked by filterProps.
API
Return values
Properties and methods exposed by the composable return object.
- props
- The same props object passed in, re-exposed for convenience.
- filterProps
- Picks the intersection of properties keys with the declared prop surface, then removes undefined values. The excludes list defaults to ["class", "style", "id"] — class and style forwarding is handled separately via $attrs.
Usage
Examples
Ready-to-paste usage snippets.
Forward a safe prop subset to a child
Custom excludes