[google-translator]
Summer Sale Alert! Save 20% on WP Theme Bundle: 240+ WP Themes & 5 Plugins. Use Code "SIZZLE20"
Summer Splash Sale: Dive into 25% Off On All Our Premium WordPress Themes! Use Coupon Code "SPLASH25" at Checkout.

Using Gutenberg Block Variations In The WordPress Block Editor

In addition to the block styles, there is also the option of creating Gutenberg block variations. With both methods, you use the standard blocks as a basis. This approach is useful if you need a variant of an existing block.

Gutenberg Block Variations

With block styles you change the appearance of the block via CSS, the block variations can be given additional elements. The block styles appear in the sidebar on the right, the block variations can be found directly in the inserter where you select a block.

Gutenberg brings examples of both block styles and block variations. The two versions of the quote block are block styles; the column block is a block variant.

You can do a little more with block variations than with block styles. For example, you can insert placeholders for text or images.

How Do Block Variations Work?

Block variations work on the same principle as with block styles. 

If you take a look on the developer.wordpress.org you’ll see those block style variations actually allow providing alternative stylings to the existing block.

For example, default WordPress call-to-action buttons can have different styles, backgrounds, border-radius, etc. Even though WordPress provides different background colors and the ability to have border-radius but sometimes you just want some kind of a predefined layout where you don’t really have to go and select different colors every time. At times you might also want to disable these because you don’t want the editors to accidentally select these colors and create some buttons that may not even fit with the design.

So, in such cases, it is wise to have a variation in this style so you can program that by adding a class name to the block’s wrapper. When you register a specific block style it predominantly adds a specific class that is defined by you to that particular block. This class name can be used to provide alternative styling to the block if the style variation is selected.

When you add a block that uses variations, you’re presented with a placeholder that serves as a way to quickly start with a few precise configurations of that particular block.

There are two blocks within core WordPress that leverage block variations: The Columns and Social blocks. Instead of having to add the block, configure the number of columns, and then manually adjust the column widths. With variations, we can add any of these column layouts with a single click. This saves a ton of time and effort.

In What Context Is A Block Variation Useful?

We have discussed above, the differences between a block variation from a block style. If you only want to implement a small change in a core block, a block variation makes more sense than creating a custom block from scratch.

And then there are the block patterns (block templates). If you have developed a layout and you want to make certain modules available to the customer, then you can easily solve this using block patterns. They then all appear nicely and clearly in the template area. The advantage is that you can immediately see what the whole thing looks like because a preview image is generated automatically.

So, where exactly the block variations come into the scene? And where the line indeed lies between block variations and block patterns? Technically it is relatively simple: A block pattern consists of a combination of several blocks. Whereas, A block variation is a variant of a single block.

Conceptually, the boundaries are fluid. The question is what the customer can cope with better and what fits better into the design concept and workflow. If a project works a lot with block patterns, it can make sense to create all layout modules as patterns. Because the customer will then find all the modules in one place and can easily recognize them visually.

Hope this post was helpful to you and we may have added a bit more to your information about Gutenberg Block Variations. Wish you good luck and happy coding. We are WordPress developers providing creative WP themes. Check out our WordPress themes and choose it for having a great website creation experience.

22Bet 22Bet LV BET Wazamba Superbet Totalbet Betcris Betcris LV BET LV BET LibraBet LibraBet LibraBet BassBet Cazeus Cazeus Millioner Millioner Millioner Millioner Millioner Betclic OnlySpins Spinsy 7Signs NovaJackpot Sportuna Rollino Casinia BassBet PriBet CrownPlay QuickWin iWild Casino Posido Joker8 Casinoly Betovo CampoBet RTBet Betinia MegaPari Supabets PlanBet Asino LunuBet PariPesa PowBet FreshBet TikiTaka BillyBets WonderLuck Winrolla Betista Slotuna PriBet Juegging Yaass Casino SlotStars SpeedyBet Slingo Prime Casino eBingo PlayJango MegaCasino Betano Herna u Dedka Forbes Casino Sazka Fortuna Slottica SlottyWay SpinBounty Spinamba Bizon Casino Vox Casino Lizaro NV Casino Yep Casino Lemon Casino HotSlots Wazamba Bizon Casino Hit'n'Spin Irwin Casino Legiano Neosurf Vegas Casino SpinCity Casino Spinamba SmokAce Dobre Kasyna BDM Bet Casinia Spinanga GratoWin YaJuego DAZN Bet SpeedyBet Betsson TodoSlots Casino Gran Madrid Piñata Casino ZEbet Aupabet eBingo Wanabet StarVegas Sol Casino One Play SynotTip iFortuna Chance Sazka forBET forBET BetX MerkurXtip KingsBet Asino LunuBet PowBet FreshBet TikiTaka BillyBets WonderLuck Winrolla Betista Slotuna ForteBet VeloBet EliteBet BetGuru Wanted Dead or a Wild The Dog House Megaways Buffalo King Megaways Circle of Life Gates of Olympus 1000 Sweet Bonanza 1000 Sugar Rush 1000 Starlight Princess 1000 Dragon Tiger Dragon Tiger Gates of Olympus Gates of Olympus Sugar Rush Sugar Rush Sweet Bonanza Sweet Bonanza Dragon Tiger Dragon Tiger Big Bass Bonanza Book of Dead Book of Dead Big Bass Vegas Double Down Deluxe Sugar Rush Big Bass Hold and Spinner Rainbow Riches Even More Pots of Gold Legacy of Dead Legacy of Dead Book of Dead Book of Dead Fire Joker Auto Roulette Gates of Olympus 1000 Book of Dead Book of Dead Legacy of Dead Book of Ra Magic The Dog House Megaways 5 Lions Megaways 5 Lions Megaways Gates of Olympus Le Bandit Le Bandit Wanted Dead or a Wild Crazy Time Sweet Bonanza 1000 Sweet Bonanza 1000 Chicken Road 2.0 Chicken Road 2.0 Vegas Glitz Vegas Glitz Aviator Sugar Rush Sugar Rush Gates of Olympus Gates of Olympus Sweet Bonanza Sweet Bonanza Wanted Dead or a Wild Circle of Life Buffalo King Megaways Gates of Olympus 1000 Shining Crown Book of Ra Deluxe 6 Gates of Olympus Super Scatter Gates of Olympus Super Scatter Big Bass Bonanza 1000 Gates of Olympus 1000 Mega Fire Blaze Big Circus Sahara Riches Cash Collect Max O Bandido Explosivo O Bandido Explosivo