FIND YOUR NEXT FEW LINES

Results for “component”

Small, practical examples. Search by task or narrow things down below.

277 snippets foundClear filters
CSSResponsive conditions & sizing

Adapt a component to its own container width

CSS: Container queries respond to a selected ancestor rather than the full viewport.

CSS✓ Tested
AngularGetting Started

Bootstrap your first standalone Angular component

Bootstrap your first standalone Angular component with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularGetting Started

Call a component method from an event

Call a component method from an event with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactComponents & props

Compose a component with named content slots

Compose a component with named content slots with a small React component and explicit browser behavior.

React✓ Tested
JavaScriptRegular expressions & URL encoding

Decode a percent-encoded URL component

JavaScript: decodeURIComponent reverses percent encoding and throws for malformed sequences.

JavaScript✓ Tested
TypeScriptRegular expressions & URL encoding

Decode a percent-encoded URL component

TypeScript: decodeURIComponent reverses percent encoding and throws for malformed sequences.

TypeScript✓ Tested
ReactComponents & props

Destructure nested data in a component

Destructure nested data in a component with a small React component and explicit browser behavior.

React✓ Tested
AngularGetting Started

Display a component field with interpolation

Display a component field with interpolation with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
PythonFile operations & archives

Extract filename components

Python: Use pathlib properties to separate a directory, filename stem, and suffix.

Python✓ Tested
AngularLifecycle & observable data

Initialize component data with ngOnInit

Initialize component data with ngOnInit with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactAsync work & status

Inject a data loader into a component

Inject a data loader into a component with a small React component and explicit browser behavior.

React✓ Tested
AngularGetting Started

Inject a service into a component

Inject a service into a component with a standalone Angular component and explicit browser behavior.

Angular✓ Tested