// Master modern frontend technologies including React, Vue, Angular, TypeScript, Next.js, CSS architecture, and responsive design. Use when working with frontend frameworks, styling, or browser APIs.
| name | frontend-technologies |
| description | Master modern frontend technologies including React, Vue, Angular, TypeScript, Next.js, CSS architecture, and responsive design. Use when working with frontend frameworks, styling, or browser APIs. |
import React, { useState } from 'react';
function Counter() {
const [count, setCount] = useState(0);
return (
<div>
<p>Count: {count}</p>
<button onClick={() => setCount(count + 1)}>
Increment
</button>
</div>
);
}
import { ref } from 'vue';
export default {
setup() {
const count = ref(0);
return {
count,
increment: () => count.value++
};
}
};
interface Props {
message: string;
onSubmit: (value: string) => void;
}
const MyComponent: React.FC<Props> = ({ message, onSubmit }) => {
return <div onClick={() => onSubmit(message)}>{message}</div>;
};
/* BEM Naming Convention */
.card { }
.card__header { }
.card__header--highlighted { }
/* CSS Variables */
:root {
--primary-color: #007bff;
--spacing-unit: 8px;
}
.button {
background: var(--primary-color);
padding: calc(var(--spacing-unit) * 2);
}
// Union and Intersection Types
type Success = { status: 'success'; data: unknown };
type Error = { status: 'error'; message: string };
type Result = Success | Error;
// Generics
function process<T, K extends keyof T>(obj: T, key: K): T[K] {
return obj[key];
}
// Conditional Types
type Flatten<T> = T extends Array<infer U> ? U : T;
// Utility Types
type Partial<T> = { [K in keyof T]?: T[K] };
type Readonly<T> = { readonly [K in keyof T]: T[K] };
See Also: design-system, responsive-design-patterns