A style guide is a document that outlines the visual elements of a design, such as typography, color palette, and iconography. It provides guidelines on how these elements should be used and implemented in a product, to ensure consistency and cohesiveness in the user interface. Style guides also include information on the use of branding elements, such as logos, and how they should be used in different contexts.
A pattern library, on the other hand, is a collection of all the components used in a design, along with their corresponding codes. This can include things like buttons, forms, and navigation elements, as well as the code that is used to create and implement them. Pattern libraries are usually focused on the technical implementation of the components, rather than the visual design elements.
Both style guides and pattern libraries are subsets of a design system. A design system is a comprehensive set of design principles, guidelines, and reusable components that help to create a cohesive and consistent user experience across a product or organization. It includes both visual design elements as outlined in a style guide and the technical implementation of the components as in a pattern library.